<?php

//	Author: 	Aris Michail
//	Email:		std03055@di.uoa.gr
//	Purpose: 	Get all deleted categories

require_once ("../DB/connection.php");
require_once ("../DB/defines.php");
require_once ("../Frameworks/Objects/user.php");
require_once ("../Frameworks/Objects/category.php");
require_once ("../Frameworks/Objects/attribute.php");

function DB_getDeletedCategories()
{

    global $conn;

    // The name of the stored procedure
    $sp_name = "usp_getDeletedCategories";

    // The return variable
    $retval;

    // Create a new statement
    $stmt = mssql_init($sp_name, $conn);

    // Bind values
    mssql_bind($stmt, "RETVAL", $retval, SQLINT4, true, false, 1);

    // Execute the statement
    $status = mssql_execute($stmt);
    if ($status)
    {
        $categories = array();
        $i = '0';
        while ($row = mssql_fetch_row($status))
        {
            $categories[$i][0] = $row[0];
            $categories[$i][1] = $row[1];
            $i++;
            mssql_next_result($status);
        }
        return $categories;
    }
}

?>